package com.qbao.newim.qbdb;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.qbao.newim.model.IMFriendInfo;
import com.qbao.newim.model.IMGroupInfo;
import com.qbao.newim.model.IMGroupUserInfo;
import com.qbao.newim.model.IMOfficialInfo;
import com.qbao.newim.model.IMUserInfo;
import com.qbao.newim.model.message.GcDBMessageModel;
import com.qbao.newim.model.message.ScDBMessageModel;
import com.qbao.newim.model.MsgCountModel;
import com.qbao.newim.model.SessionModel;

import com.qbao.newim.qbdb.IMFriendInfoDao;
import com.qbao.newim.qbdb.IMGroupInfoDao;
import com.qbao.newim.qbdb.IMGroupUserInfoDao;
import com.qbao.newim.qbdb.IMOfficialInfoDao;
import com.qbao.newim.qbdb.IMUserInfoDao;
import com.qbao.newim.qbdb.GcDBMessageModelDao;
import com.qbao.newim.qbdb.ScDBMessageModelDao;
import com.qbao.newim.qbdb.MsgCountModelDao;
import com.qbao.newim.qbdb.SessionModelDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig iMFriendInfoDaoConfig;
    private final DaoConfig iMGroupInfoDaoConfig;
    private final DaoConfig iMGroupUserInfoDaoConfig;
    private final DaoConfig iMOfficialInfoDaoConfig;
    private final DaoConfig iMUserInfoDaoConfig;
    private final DaoConfig gcDBMessageModelDaoConfig;
    private final DaoConfig scDBMessageModelDaoConfig;
    private final DaoConfig msgCountModelDaoConfig;
    private final DaoConfig sessionModelDaoConfig;

    private final IMFriendInfoDao iMFriendInfoDao;
    private final IMGroupInfoDao iMGroupInfoDao;
    private final IMGroupUserInfoDao iMGroupUserInfoDao;
    private final IMOfficialInfoDao iMOfficialInfoDao;
    private final IMUserInfoDao iMUserInfoDao;
    private final GcDBMessageModelDao gcDBMessageModelDao;
    private final ScDBMessageModelDao scDBMessageModelDao;
    private final MsgCountModelDao msgCountModelDao;
    private final SessionModelDao sessionModelDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        iMFriendInfoDaoConfig = daoConfigMap.get(IMFriendInfoDao.class).clone();
        iMFriendInfoDaoConfig.initIdentityScope(type);

        iMGroupInfoDaoConfig = daoConfigMap.get(IMGroupInfoDao.class).clone();
        iMGroupInfoDaoConfig.initIdentityScope(type);

        iMGroupUserInfoDaoConfig = daoConfigMap.get(IMGroupUserInfoDao.class).clone();
        iMGroupUserInfoDaoConfig.initIdentityScope(type);

        iMOfficialInfoDaoConfig = daoConfigMap.get(IMOfficialInfoDao.class).clone();
        iMOfficialInfoDaoConfig.initIdentityScope(type);

        iMUserInfoDaoConfig = daoConfigMap.get(IMUserInfoDao.class).clone();
        iMUserInfoDaoConfig.initIdentityScope(type);

        gcDBMessageModelDaoConfig = daoConfigMap.get(GcDBMessageModelDao.class).clone();
        gcDBMessageModelDaoConfig.initIdentityScope(type);

        scDBMessageModelDaoConfig = daoConfigMap.get(ScDBMessageModelDao.class).clone();
        scDBMessageModelDaoConfig.initIdentityScope(type);

        msgCountModelDaoConfig = daoConfigMap.get(MsgCountModelDao.class).clone();
        msgCountModelDaoConfig.initIdentityScope(type);

        sessionModelDaoConfig = daoConfigMap.get(SessionModelDao.class).clone();
        sessionModelDaoConfig.initIdentityScope(type);

        iMFriendInfoDao = new IMFriendInfoDao(iMFriendInfoDaoConfig, this);
        iMGroupInfoDao = new IMGroupInfoDao(iMGroupInfoDaoConfig, this);
        iMGroupUserInfoDao = new IMGroupUserInfoDao(iMGroupUserInfoDaoConfig, this);
        iMOfficialInfoDao = new IMOfficialInfoDao(iMOfficialInfoDaoConfig, this);
        iMUserInfoDao = new IMUserInfoDao(iMUserInfoDaoConfig, this);
        gcDBMessageModelDao = new GcDBMessageModelDao(gcDBMessageModelDaoConfig, this);
        scDBMessageModelDao = new ScDBMessageModelDao(scDBMessageModelDaoConfig, this);
        msgCountModelDao = new MsgCountModelDao(msgCountModelDaoConfig, this);
        sessionModelDao = new SessionModelDao(sessionModelDaoConfig, this);

        registerDao(IMFriendInfo.class, iMFriendInfoDao);
        registerDao(IMGroupInfo.class, iMGroupInfoDao);
        registerDao(IMGroupUserInfo.class, iMGroupUserInfoDao);
        registerDao(IMOfficialInfo.class, iMOfficialInfoDao);
        registerDao(IMUserInfo.class, iMUserInfoDao);
        registerDao(GcDBMessageModel.class, gcDBMessageModelDao);
        registerDao(ScDBMessageModel.class, scDBMessageModelDao);
        registerDao(MsgCountModel.class, msgCountModelDao);
        registerDao(SessionModel.class, sessionModelDao);
    }
    
    public void clear() {
        iMFriendInfoDaoConfig.clearIdentityScope();
        iMGroupInfoDaoConfig.clearIdentityScope();
        iMGroupUserInfoDaoConfig.clearIdentityScope();
        iMOfficialInfoDaoConfig.clearIdentityScope();
        iMUserInfoDaoConfig.clearIdentityScope();
        gcDBMessageModelDaoConfig.clearIdentityScope();
        scDBMessageModelDaoConfig.clearIdentityScope();
        msgCountModelDaoConfig.clearIdentityScope();
        sessionModelDaoConfig.clearIdentityScope();
    }

    public IMFriendInfoDao getIMFriendInfoDao() {
        return iMFriendInfoDao;
    }

    public IMGroupInfoDao getIMGroupInfoDao() {
        return iMGroupInfoDao;
    }

    public IMGroupUserInfoDao getIMGroupUserInfoDao() {
        return iMGroupUserInfoDao;
    }

    public IMOfficialInfoDao getIMOfficialInfoDao() {
        return iMOfficialInfoDao;
    }

    public IMUserInfoDao getIMUserInfoDao() {
        return iMUserInfoDao;
    }

    public GcDBMessageModelDao getGcDBMessageModelDao() {
        return gcDBMessageModelDao;
    }

    public ScDBMessageModelDao getScDBMessageModelDao() {
        return scDBMessageModelDao;
    }

    public MsgCountModelDao getMsgCountModelDao() {
        return msgCountModelDao;
    }

    public SessionModelDao getSessionModelDao() {
        return sessionModelDao;
    }

}
